package com.imooc.springboot.study;

import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * <h1>应用启动类</h1>
 * EnableScheduling 开启定时功能
 * EnableAsync 开启异步的功能
 */
@SpringBootApplication
//@EnableScheduling
@EnableAsync
public class SpringBootStudyApplication {
    public static void main(String[] args) {
        //1.通过静态run方法
//        SpringApplication.run(SpringBootStudyApplication.class, args);
        //2.通过api调整应用的行为
        /*
        SpringApplication application = new SpringApplication(SpringBootStudyApplication.class);
        application.setBannerMode(Banner.Mode.OFF);
        application.setWebApplicationType(WebApplicationType.NONE);
        application.run(args);*/

        //3.SpringApplicationBuilder Fluent Api,链式调用
        new SpringApplicationBuilder(SpringBootStudyApplication.class)
//                .bannerMode(Banner.Mode.OFF)
//                .web(WebApplicationType.NONE)
                .run(args);

    }
}
